package com.team.frame.utils.swagger;

import com.google.common.collect.Sets;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by lidan on 2017/1/20.
 */
@Configuration
@EnableWebMvc
@EnableSwagger2
public class ApplicationSwaggerConfig {
    @Bean
    public Docket apiDocket() {
        Docket docket = new Docket(DocumentationType.SWAGGER_2);
        docket.produces(Sets.newHashSet("application/json")).protocols(Sets.newHashSet("http")).forCodeGeneration(true);
        return docket;

    }
}
